package com.sky.mapper;

import com.github.pagehelper.Page;
import com.sky.autofill.fill;
import com.sky.entity.Dish;
import com.sky.enumeration.OperationType;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface DishMapper {
    @fill(value = OperationType.INSERT)
    void insert(Dish dish);

    Page<Dish> select(Dish dish);
    @fill(OperationType.UPDATE)
    void update(Dish dish);

    List<String> SelectById(List<Long> list);

    void Delete(List<Long> list);
    @Select("select * from dish where id  = #{id}")
    Dish GetById(Long id);
    @Select("select * from dish where category_id = #{id}")
    List<Dish> GetDishesByCategoryId(Long id);

}
